<template>
	<view>
		<view class="container">
			<view class="information_list">
				<view class="information_name">旧密码</view>
				<input class="information_inner" type="text" v-model="form.oldNumber" />
			</view>
			<view class="information_list">
				<view class="information_name">新密码</view>
				<input class="information_inner" type="text" v-model="form.newNumber" />
			</view>
			<view class="information_list">
				<view class="information_name">重输新密码</view>
				<input class="information_inner" type="text" v-model="form.repeatNewNumber" />
			</view>
			
			
			<button class="add-btn" @click="confirm">确认修改</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {
					oldNumber: '',
					newNumber: '',
					repeatNewNumber: ''
				},
			}
		},
		methods: {
			confirm(){
					const that = this
					that.$api.request('/api/web','/changePass', {
						oldPass: that.form.oldNumber,
						newPass: that.form.newNumber,
						newPass2: that.form.repeatNewNumber,
					}, (failres => {
						uni.showToast({
							title:failres.msg
						})
						
					})).then(res => {
						console.log("res",res);
						uni.redirectTo({
							url: './login'
						})
					})
				
			}
		}
	}
</script>

<style lang="scss">
	page{
		background: $page-color-base;
	}
	.information_list{
		width: 100%;
		height: 80upx;
		background: #FFFFFF;
		border-bottom: 1upx solid #efefef;
		display: flex;
		align-items: center;
		position: relative;
		.information_name{
			font-size: 28upx;
			color: #333333;
			margin-left: 20upx;
			width: 200upx;
			.red_color{
				color: red;
				margin-right: 10upx;
			}
		}
		.information_inner{
			outline: none;
		}
		.ver_code{
			position: absolute;
			right: 30upx;
			font-size: 28upx;
			padding: 5upx 10upx;
			border: 1upx solid #EBEEF5;
			border-radius: 5upx;
		}
	}
	.add-btn{
		display: flex;
		align-items: center;
		justify-content: center;
		width: 690upx;
		height: 80upx;
		margin: 60upx auto;
		font-size: $font-lg;
		color: #fff;
		background-color: $base-color;
		border-radius: 10upx;
		box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
	}
	
</style>
